-
Notifications
You must be signed in to change notification settings - Fork 0
refactor: refactor code upload system and remove user_id fields #75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Refactored the Construe uploadCodeSystem API to simplify the request structure and improve asynchronous processing behavior. Updated the upload request interface to use a single unified structure instead of separate CSV and JSON variants. Also removed user_id fields across multiple resource templates to streamline data models. Key changes: - Unified UploadRequest interface with simplified structure and format enum - Updated uploadCodeSystem to return immediately with 202 status and process asynchronously - Removed user_id fields from ChatMessageTemplate, ChatSessionTemplate, FhirProviderTemplate, SummaryTemplate, McpServerResponse, WorkflowDefinition, and WorkflowResponse - Added name and version fields to upload response for better tracking - Updated documentation to reflect async processing pattern - Reorganized construe types and moved UploadRequest to client/requests directory 🌿 Generated with Fern
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| export type { GetConstrueCodesCodesystemSearchTextRequest } from "./GetConstrueCodesCodesystemSearchTextRequest.js"; | ||
| export type { GetConstrueCodesSystemsCodesystemExportRequest } from "./GetConstrueCodesSystemsCodesystemExportRequest.js"; | ||
| export type { GetConstrueCodesSystemsCodesystemRequest } from "./GetConstrueCodesSystemsCodesystemRequest.js"; | ||
| export type { UploadRequest } from "./UploadRequest.js"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Type-only export strips runtime Format const values
Medium Severity
The UploadRequest is exported via export type { UploadRequest }, which strips the runtime Format const from the namespace. Consumers can use the UploadRequest interface and UploadRequest.Format as a type, but cannot access UploadRequest.Format.Csv or UploadRequest.Format.Json as runtime values. The Format const defined in the namespace becomes dead code — it exists but is unreachable through the public API. All other enum-like consts in the codebase (e.g. GetCodeSystemDetailResponse.Status) live in the types/ directory and are properly re-exported with export *.
Additional Locations (1)
| file: "file", | ||
| code_col: "code", | ||
| desc_col: "description", | ||
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test mocks 200 status instead of documented 202
Low Severity
The success-case test for uploadCodeSystem mocks a 200 status code, but the updated documentation and PR description state the endpoint now returns 202 immediately for async processing. The response body was correctly updated to { status: "processing", ... }, but the mock status code was not changed to match. While both 200 and 202 are treated as success by the fetcher, the test doesn't validate the actual expected API contract.


Refactored the Construe uploadCodeSystem API to simplify the request structure and improve asynchronous processing behavior. Updated the upload request interface to use a single unified structure instead of separate CSV and JSON variants. Also removed user_id fields across multiple resource templates to streamline data models.
Key changes:
🌿 Generated with Fern
Note
Medium Risk
This is a breaking API-surface change (request/response shapes and removed fields) that can impact downstream consumers, though it’s largely mechanical/type-level and covered by updated wire tests.
Overview
Breaking SDK update to v6.0.0 that refactors
construe.uploadCodeSystemto use a singleconstrue.UploadRequesttype (with aformatenum) and removes the older CSV/JSON discriminated-union request types from the exported Construe type surface.uploadCodeSystemis documented/positioned as async processing (immediate acceptance with polling viaGET /construe/codes/systems/{codesystem}) and the upload response now includesnameandversionalongsidestatus. Multiple resource template types dropuser_idfields (agent chat message/session, FHIR provider, summary templates, MCP server/tool responses, workflows), with wire tests updated accordingly.Written by Cursor Bugbot for commit aa3b0d9. This will update automatically on new commits. Configure here.